package com.job.model.admin;

import java.io.Serializable;

public class PrivilegePrimaryKey implements Serializable {
	private static final long serialVersionUID = 1L;
	private Group group;
	private Resource resource;
	public Group getGroup() {
		return group;
	}
	public void setGroup(Group group) {
		this.group = group;
	}
	public Resource getResource() {
		return resource;
	}
	public void setResource(Resource resource) {
		this.resource = resource;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((group == null) ? 0 : group.hashCode());
		result = prime * result
				+ ((resource == null) ? 0 : resource.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PrivilegePrimaryKey other = (PrivilegePrimaryKey) obj;
		if (group == null) {
			if (other.group != null)
				return false;
		} else if (!group.equals(other.group))
			return false;
		if (resource == null) {
			if (other.resource != null)
				return false;
		} else if (!resource.equals(other.resource))
			return false;
		return true;
	}
	
	public PrivilegePrimaryKey() {
		
	}
	public PrivilegePrimaryKey(Group group, Resource resource) {
		super();
		this.group = group;
		this.resource = resource;
	}
}
